diff options
| author | Adam Soltys <[email protected]> | 2023-12-06 09:11:26 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-12-06 09:11:26 -0800 |
| commit | 54f6d24f819816d6d687dab7291e9db334286e52 (patch) | |
| tree | 08ac44f27197ad6dc56f2ee64e453fb86d4a3882 /src/routes/(app)/[username]/settings | |
| parent | 2aeb69b785485acdf0f13ba4b2e8ef33dca33c1e (diff) | |
| download | coinos-ui-54f6d24f819816d6d687dab7291e9db334286e52.tar.gz coinos-ui-54f6d24f819816d6d687dab7291e9db334286e52.zip | |
verify email
Diffstat (limited to 'src/routes/(app)/[username]/settings')
| -rw-r--r-- | src/routes/(app)/[username]/settings/[...tab]/+page.svelte | 14 | ||||
| -rw-r--r-- | src/routes/(app)/[username]/settings/[...tab]/_pos.svelte | 12 |
2 files changed, 20 insertions, 6 deletions
diff --git a/src/routes/(app)/[username]/settings/[...tab]/+page.svelte b/src/routes/(app)/[username]/settings/[...tab]/+page.svelte index b7a9ccfb..d0ee7eba 100644 --- a/src/routes/(app)/[username]/settings/[...tab]/+page.svelte +++ b/src/routes/(app)/[username]/settings/[...tab]/+page.svelte @@ -8,7 +8,7 @@ import Spinner from "$comp/Spinner.svelte"; import Pin from "$comp/Pin.svelte"; import { t } from "$lib/translations"; - import { fail, post, warning, success } from "$lib/utils"; + import { fail, post, sleep, warning, success } from "$lib/utils"; import { avatar, banner, password, pin } from "$lib/store"; import { upload } from "$lib/upload"; import { page } from "$app/stores"; @@ -128,13 +128,19 @@ await sign({ event, user }); await send(event); } catch (e) { - warning("nostr profile could not be updated"); + warning("Nostr profile could not be updated"); } } if (user.email !== prev.email) { - await post("/api/verify", { test: true }); - } + try { + await post("/api/request", user); + warning("Verification email sent"); + await sleep(4000); + } catch(e) { + console.log(e); + } + } const response = await fetch(formElement.action, { method: "POST", diff --git a/src/routes/(app)/[username]/settings/[...tab]/_pos.svelte b/src/routes/(app)/[username]/settings/[...tab]/_pos.svelte index cbf31a68..ed9f1ac4 100644 --- a/src/routes/(app)/[username]/settings/[...tab]/_pos.svelte +++ b/src/routes/(app)/[username]/settings/[...tab]/_pos.svelte @@ -33,12 +33,20 @@ </select> </div> -<div class="space-y-1"> +<div class="space-y-1 relative"> <label for="email" class="font-bold block">{$t("user.settings.email")}</label> <p class="text-secondary"> {$t("user.settings.emailDescription")} </p> - <input type="text" name="email" bind:value={user.email} /> + + <div class="relative"> + <input type="text" name="email" bind:value={user.email} /> + {#if user.verified} + <Icon icon="check" style="absolute right-5 top-3 w-8" /> + {:else} + <Icon icon="orangeclock" style="absolute right-5 top-3 w-8" /> + {/if} + </div> </div> <div> |
